package com.azt.provider.impl;

import com.azt.api.pojo.LevelRecord;
import com.azt.api.service.LevelRecordService;
import com.azt.model.page.Pagination;
import com.azt.provider.mapper.LevelRecordMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 用户记录明细
 * Created by LiQZ on 2017/4/13.
 */
@Service
public class LevelRecordServiceImpl implements LevelRecordService {

    @Autowired
    private LevelRecordMapper levelRecordMapper;

    @Override
    public Pagination listPage(int pageNo, int pageSize, Map<String, Object> params) {
        Page<Object> startPage = PageHelper.startPage(pageNo, pageSize);
        List<LevelRecord> list = levelRecordMapper.selectByCondition(params);
        Pagination p = new Pagination(startPage, list);
        p.setList(list);
        return p;
    }

}
